//author:kakake
class tscnmedpresController {
    public data = {
        dbConn: TSLobsterAPI.Program.GetDbConn()
    }
    //获取中药方剂
    getcnMedPres() {
        var drugName = TSLobsterAPI.Program.RequestQuery('drugName', '');
        var pageInfo = {
            key: "方剂名称",
            page: TSLobsterAPI.Program.RequestQuery('page', 0),
            perPage: TSLobsterAPI.Program.RequestQuery('limit', 10),
            totalRecord: 0,
            totalPage: 0
        }
        var strsql = "SELECT 方剂名称,方剂组成,分类,功用,主治,炮制,用法用量,方解,禁忌,化裁,附方,附注,文献,运用 FROM [中药方-金匮要略] \
                where 方剂名称 like @drugName ";

        var dbparams = {
            drugName: '%' + drugName + '%'
        }

        //获取分页Sql和条数
        var list = TSLobsterAPI.DbHelper.DbGetJsonData(this.data.dbConn, strsql, dbparams, pageInfo);

        return { list: list, count: pageInfo.totalRecord };
    }
}